home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / dialogs.zip / TESTCASE.PAS < prev   
Pascal/Delphi Source File  |  1992-07-30  |  1KB  |  62 lines

  1. {$X+}
  2. program TestCase;
  3.  
  4. uses Dos, Memory, Objects, Drivers, Views, Menus, Dialogs, App, StdDlg,
  5.      Editors, ColorTxt, InpLong;
  6.  
  7. Const
  8.   cmTry = 150;
  9.   cmButton = 151;
  10.  
  11. type
  12.   TListboxRec = record
  13.     PS : PStringCollection;
  14.     Focused : Integer;
  15.     end;
  16. type
  17.   TMyApp = object(TApplication)
  18.     procedure InitStatusLine; virtual;
  19.     procedure HandleEvent(var Event: TEvent); virtual;
  20.     end;
  21.  
  22. var
  23.   MyApp: TMyApp;
  24.   Dialog : PDialog;
  25.  
  26. procedure TMyApp.InitStatusLine;
  27. var R: TRect;
  28. begin
  29.   GetExtent(R);
  30.   R.A.Y := R.B.Y - 1;
  31.   StatusLine := New(PStatusLine, Init(R,
  32.     NewStatusDef(0, $FFFF,
  33.       NewStatusKey('~Alt-X~ Exit', kbAltX, cmQuit,
  34.       NewStatusKey('~F9~ Try dialog', kbF9, cmTry,
  35.       nil)),
  36.     nil)
  37.   ));
  38. end;
  39.  
  40. (*----Insert MakeDialog here----*)
  41.  
  42.  
  43. procedure TMyApp.HandleEvent(var Event: TEvent);
  44. begin
  45. TApplication.HandleEvent(Event);
  46.  
  47. if (Event.What = evCommand) and (Event.Command = cmTry) then
  48.   begin
  49.   Dialog := MakeDialog;
  50.   DeskTop^.ExecView(Dialog);
  51.   Dispose(Dialog, Done);
  52.   ClearEvent(Event);
  53.   end;
  54. end;
  55.  
  56. begin
  57.   MyApp.Init;
  58.   MyApp.Run;
  59.   MyApp.Done;
  60. end.
  61.  
  62.